home *** CD-ROM | disk | FTP | other *** search
- property ancestor, pPathFunctionData, pPathData, pCurrentLoc, pStartLoc, pRefName
-
- on birth me, arguments
- set the ancestor of me to birth(script "Animator", arguments)
- set the pPathFunctionData of me to the pathData of arguments
- set pStartLoc to the location of arguments
- set pRefName to the RefName of arguments
- set pCurrentLoc to pStartLoc
- return me
- end
-
- on moveSprite me
- set theResult to GenLoc(me)
- set the pCurrentLoc of me to theResult
- set the loc of sprite the pChannel of me to the pCurrentLoc of me
- end
-
- on GenLoc me
- set OBJref to the pRefName of me
- set thisList to getaProp(getaProp(gObjects, OBJref), #graphList)
- if voidp(thisList) then
- exit
- end if
- if voidp(getaProp(getaProp(gObjects, OBJref), #animator)) then
- set startloc to getaProp(getaProp(gObjects, OBJref), #onloc)
- else
- set startloc to the pCurrentLoc of getaProp(getaProp(gObjects, OBJref), #animator)
- end if
- set V to the locV of startloc
- set H to the locH of startloc + getaProp(thisList, #frameHStep)
- if H > getaProp(thisList, #maxHLoc) then
- set H to getaProp(thisList, #minHLoc)
- end if
- if random(2) = 1 then
- set V to V + random(getaProp(thisList, #maxRandomInt))
- if V > getaProp(thisList, #maxVLoc) then
- set V to V - random(getaProp(thisList, #maxRandomInt))
- end if
- else
- set V to V - random(getaProp(thisList, #maxRandomInt))
- if V < getaProp(thisList, #minVLoc) then
- set V to V + random(getaProp(thisList, #maxRandomInt))
- end if
- end if
- return point(H, V)
- end
-